<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>我的问答</title>
    <link rel="stylesheet" type="text/css" href="__CSS__api.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__aui.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__dropload.css" />


    <style>
        .aui-bar-nav .aui-iconfont {
            position: relative;
            font-family: "aui_iconfont" !important;
            font-size: 0.75rem;
            color: #E73C5C;
            font-style: normal;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            height: 2.4rem;

        }

        .aui-bar-nav {
            background-color: #fff;
        }

        .aui-icon-tu {
            height: 2.4rem;
            width: 49px;
            background: url('__IMG__left.png') no-repeat 0.5rem center;
            background-size: 22px 22px;
        }

        .aui-bar-nav .aui-pull-right {
            padding-right: 0.75rem;
        }

        .aui-bar-nav .aui-title {
            font-size: 0.9rem;
            color: #333333;
            font-weight: 500;
        }
        .nav{
            background-color: #fff;
            width: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .font{
            height: 2rem;
            flex: 1;
            font-size:0.8rem;
            color:#333333;
            line-height:2rem;
            text-align: center;
        }
        /*tab*/

        .aui-tab-item.aui-active {
            color: #E73C5C;
            font-weight: bold;
            font-size: 0.8rem;
            position: relative;
            border: 0;
        }

        .aui-active:after {
            content: '';
            display: block;
            height: 0px;
            width: 100%;
            border-top: 2px solid #E73C5C;
            bottom: 0px;
            left: 0;
            position: absolute;
        }

        .sss {
            margin: 0px 15px;
            width: 100%;
        }

        .aui-tab-item {
            height: 2.4rem;
            line-height: 2.4rem;
            font-size: 0.8rem;
            color: #333;
        }
        body{
            background-color: #F5F5F5;
        }
        .warrp{
            width: 100%;
            background-color: #FFFFFF;
            padding: 0.75rem 0.75rem 0.7rem 0.75rem;
        }
        .title{
            font-size:0.75rem;
            line-height:1.05rem;
            color: #4D4D4D;
        }
        .content{
            font-size:0.7rem;
            color: #808080;
            line-height:1rem;
            margin-top: 0.75rem;
        }
        .good-time{
            width: 100%;
            margin-top: 0.75rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .good{
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .tu img{
            width: 1rem;
            height: 1rem;
        }
        .shu{
            font-size:0.8rem;
            color:#B3B3B3;
            line-height:1rem;
            margin-left: 0.5rem;
        }
        .time{
            font-size:0.65rem;
            color: #CCCCCC;
            line-height:1rem;
        }
    </style>
</head>

<body>
<div class="l_box"  id="loading2"><img src="__IMG__loading.gif" alt="" id="loading"></div>

<header class="aui-bar aui-bar-nav underLine" style="padding-top:25px;" id="header">
    <a class="aui-pull-left" tapmode="active" onclick="history.go(-1)"> <span class="aui-iconfont aui-icon-tu"> </span> </a>
    <div class="aui-title" style="font-size0.8rem;font-weight:bold">问答</div>
</header>
<div class="aui-tab bar underLine" id="tab1">
    <div class="underLine sss aui-tab" id="tab">
        <div class="aui-tab-item" id="tw" onclick="tw()">提问</div>
        <div class="aui-tab-item aui-active" id="wd" >回答</div>
    </div>
</div>

<div class="upOrDown">
    <div class="tiwen lists hidden" id="tiw">
        <div class="kong" style="margin-top:5.8rem" >
            <img src="__IMG__quesheng/no_collect.png" class="">
            <div class="seatName1">暂无提问</div>
        </div>
        <div id="tiwenlist">
            <!--<div class="warrp" onclick="fnDetails()" tapmode='active'>-->
            <!--<div class="title">-->
            <!--感冒了该不该吃药？很多人都会有疑问1-->
            <!--</div>-->
            <!--<div class="content">-->
            <!--感冒一定要吃药吗.还是只喝水就好呢?希望专家给点建议，感冒一定要吃药吗.还是只喝水就好呢?-->
            <!--</div>-->
            <!--<div class="good-time">-->
            <!--<div class="good">-->
            <!--<div class="tu">-->
            <!--<img src="__IMG__liuyan.png" alt="">-->
            <!--</div>-->
            <!--<div class="shu">-->
            <!--12-->
            <!--</div>-->
            <!--</div>-->
            <!--<div class="time">-->
            <!--2016-12-22  12:23-->
            <!--</div>-->
            <!--</div>-->
            <!--</div>-->
            <!--<div class="warrp" style="margin-top: 0.5rem;">-->
            <!--<div class="title">-->
            <!--感冒了该不该吃药？很多人都会有疑问-->
            <!--</div>-->
            <!--<div class="content">-->
            <!--感冒一定要吃药吗.还是只喝水就好呢?希望专家给点建议，感冒一定要吃药吗.还是只喝水就好呢?-->
            <!--</div>-->
            <!--<div class="good-time">-->
            <!--<div class="good">-->
            <!--<div class="tu">-->
            <!--<img src="__IMG__liuyan.png" alt="">-->
            <!--</div>-->
            <!--<div class="shu">-->
            <!--12-->
            <!--</div>-->
            <!--</div>-->
            <!--<div class="time">-->
            <!--2016-12-22  12:23-->
            <!--</div>-->
            <!--</div>-->
            <!--</div>-->
        </div>

    </div>

    <div class="huida lists" id="huid">
        <div class="kong" style="margin-top:5.8rem" >
            <img src="__IMG__quesheng/no_collect.png" class="">
            <div class="seatName1">暂无提问</div>
        </div>
        <div id="huidalist">
            <!--<div class="warrp" onclick="fnDetails()" tapmode='active'>-->
            <!--<div class="title">-->
            <!--感冒了该不该吃药？很多人都会有疑问2-->
            <!--</div>-->
            <!--<div class="content">-->
            <!--感冒一定要吃药吗.还是只喝水就好呢?希望专家给点建议，感冒一定要吃药吗.还是只喝水就好呢?-->
            <!--</div>-->
            <!--<div class="good-time">-->
            <!--<div class="good">-->
            <!--<div class="tu">-->
            <!--<img src="__IMG__dianzan.png" alt="">-->
            <!--</div>-->
            <!--<div class="shu">-->
            <!--12-->
            <!--</div>-->
            <!--</div>-->
            <!--<div class="time">-->
            <!--2016-12-22  12:23-->
            <!--</div>-->
            <!--</div>-->
            <!--</div>-->
            <!--<div class="warrp" style="margin-top: 0.5rem;">-->
            <!--<div class="title">-->
            <!--感冒了该不该吃药？很多人都会有疑问-->
            <!--</div>-->
            <!--<div class="content">-->
            <!--感冒一定要吃药吗.还是只喝水就好呢?希望专家给点建议，感冒一定要吃药吗.还是只喝水就好呢?-->
            <!--</div>-->
            <!--<div class="good-time">-->
            <!--<div class="good">-->
            <!--<div class="tu">-->
            <!--<img src="__IMG__dianzan.png" alt="">-->
            <!--</div>-->
            <!--<div class="shu">-->
            <!--12-->
            <!--</div>-->
            <!--</div>-->
            <!--<div class="time">-->
            <!--2016-12-22  12:23-->
            <!--</div>-->
            <!--</div>-->
            <!--</div>-->
        </div>

    </div>
</div>

<div class="toast-wrap">
    <span class="toast-msg"></span>
</div>
</body>
<script type="text/javascript" src="__JS__jquery.min.js"></script>
<script type="text/javascript" src="__JS__layer_mobile/layer.js"></script>
<script type="text/javascript" src="__JS__dropload.min.js"></script>
<script type="text/javascript" src="__JS__api.js"></script>
<script type="text/javascript" src="__JS__tt.js"></script>
<script type="text/javascript" src="__JS__common.js"></script>
<script type="text/javascript" src="__JS__aui-tab.js"></script>
<script type="text/javascript">
    var itemIndex = 1;
    var tab1LoadEnd = false;
    var tab2LoadEnd = false;
    function tw(){
        location.href='{:url("My/my_wenda")}';

    }
    function wd(){
        if (itemIndex==1) {
            return;
        }

    }
    var page=0;
    /**
     * 上拉加载，下拉刷新
     */
    var dropload = $('.upOrDown').dropload({
        scrollArea : window,
        autoLoad : true,
//        domUp : {
//            domClass   : 'dropload-up',
//            domRefresh : '<div class="dropload-refresh">↓下拉刷新-自定义内容</div>',
//            domUpdate  : '<div class="dropload-update">↑释放更新-自定义内容</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中-自定义内容...</div>'
//        },
//        domDown : {
//            domClass   : 'dropload-down',
//            domRefresh : '<div class="dropload-refresh">刷新</div>',
//            domLoad    : '<div class="dropload-load"><span class="loading"></span>加载中...</div>',
//            domNoData  : '<div class="dropload-noData">无数据</div>'
//        },
        loadDownFn : function(me){
            page++;
            var data2={
                type:2,
                page: page
            };
            $.ajax({
                url:'{:url("My/myanswer")}',
                data:data2,
                type:'POST',
                dataType:'JSON',
                success: function(data){
                    var arrLen = data.msg.length;
                    if(arrLen<=0){
                        me.lock();
//                         无数据
                        me.noData(true);
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }else{
                        var datas = data.msg;
                        getlist_huida(datas);

                        // 每次数据加载完，必须重置
                        me.resetload();
                    }


                },
                error: function(xhr, type){
                    // 即使加载出错，也得重置
                    me.resetload();
                }
            });
        },
        loadUpFn : function(me){
            // var keyword = $('input[name="cate_id"]').val();

            page = 1;
            var data2={
                type:2,
                page: page
            };
            $.ajax({
                url:'{:url("My/myanswer")}',
                data:data2,

                type:'POST',
                dataType:'json',
                success: function(data){
                    var datas = data.msg;
                    $('#huid').html('');
                    getlist_huida(datas);;

                    me.resetload();
                    me.unlock();
                    me.noData(false);
                },
                error: function(xhr, type){
                    me.resetload();
                }
            });
        }
    });

    function fnDetails(id) {
        location.href='{:url("first/answerdetail")}?id='+id;

    }
    // ajax获取数据myanswer
    function getdata() {

        loaddingOpen();
        $.ajax({
            url:'{:url("My/myanswer")}',
            data:'type='+2,
            processData: false,
            contentType: false,
            success: function (data) {
                loaddingClose();
                if (data.status=='200') {
                    if (data.data.length>0){
                        getlist_huida(data.data);
                    }else {

                        $('#tiwenlist').html('');
                        $('.kong').eq(0).show();
                    }
                }else {
                    $('#tiwenlist').html('');
                    $('.kong').eq(0).show();
                    toast(data.msg);
                }
            },
            error: function(xhr, type){
                loaddingClose();
                $('#tiwenlist').html('');
                $('.kong').eq(0).show();
                toast('无网络或连接超时，请重试！');
                // 即使加载出错，也得重置

            }
        });


    }


    function  getlist_tiwen(data) {
        var html='';
        for (var i=0;i<data.length;i++){
            html+='<div class="warrp" onclick="fnDetails('+data[i].interlocution_id+')"  style="margin-top:0.5rem;">';
            html+='<div class="title">'+data[i].interlocution_title+'</div>';
            html+='<div class="content">'+data[i].interlocution_introduce+'</div>';
            html+='<div class="good-time"><div class="good">';
            html+='<div class="tu">';
            html+='<img src="__IMG__liuyan.png" alt="">';
            html+='</div>';
            html+='<div class="shu">'+data[i].interlocution_num+'</div>';
            html+='</div>';
            html+='<div class="time">'+data[i].interlocution_time+'</div>';
            html+='</div>';
            html+='</div>';
        }
        $('#tiwenlist').append(html);
    }
    function  getlist_huida(data) {
        var html='';
        for (var i=0;i<data.length;i++){
            html+='<div class="warrp" onclick="fnDetails('+data[i].answer_id+')" style="margin-top:0.5rem;">';
            html+='<div class="title">'+data[i].interlocution_title+'</div>';
            html+='<div class="content">'+data[i].answer_content+'</div>';
            html+='<div class="good-time"><div class="good">';
            html+='<div class="tu">';
            html+='<img src="__IMG__liuyan.png" alt="">';
            html+='</div>';
            html+='<div class="shu">'+data[i].answer_zang+'</div>';
            html+='</div>';
            html+='<div class="time">'+data[i].answer_time+'</div>';
            html+='</div>';
            html+='</div>';
        }
        $('#huid').append(html);
    }
</script>
</html>
